﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Public Class PagosFact
    Public Shared Function Build(ByVal dr As OdbcDataReader) As PagosBE
        Dim tmpPagos As PagosBE = New PagosBE()
        Try
            With tmpPagos
                .AboCta = convertDTFromDb.ConvertShort(dr.Item("AboCta"))
                .Concepto = convertDTFromDb.ConvertString(dr.Item("Concepto"))
                .Conciliado = convertDTFromDb.ConvertShort(dr.Item("Conciliado"))
                .FCancela = convertDTFromDb.convertDateTime(dr.Item("FCancela"))
                .FechaApl = convertDTFromDb.convertDateTime(dr.Item("FechaApl"))
                .FechaC = convertDTFromDb.convertDateTime(dr.Item("FechaC"))
                .IdBanco = convertDTFromDb.ConvertString(dr.Item("IdBanco"))
                .IdCC = convertDTFromDb.ConvertString(dr.Item("IdCC"))
                .IdCta = convertDTFromDb.ConvertShort(dr.Item("IdCta"))
                .IdEmpresa = convertDTFromDb.ConvertShort(dr.Item("IdEmpresa"))
                .IdObra = convertDTFromDb.ConvertString(dr.Item("IdObra"))
                .IdPago = convertDTFromDb.convertInt32(dr.Item("IdPago"))
                .IdProv = convertDTFromDb.ConvertString(dr.Item("IdProv"))
                .ImporteP = convertDTFromDb.ConvertDecimal(dr.Item("ImporteP"))
                .Letra = convertDTFromDb.ConvertString(dr.Item("Letra"))
                .NoDocto = convertDTFromDb.ConvertLong(dr.Item("NoDocto"))
                .NumAuto = convertDTFromDb.ConvertString(dr.Item("NumAuto"))
                .NumCta = convertDTFromDb.ConvertString(dr.Item("NumCta"))
                .Obs = convertDTFromDb.ConvertString(dr.Item("Obs"))
                .Status = convertDTFromDb.ConvertString(dr.Item("Status"))
                .Tipo = convertDTFromDb.ConvertShort(dr.Item("Tipo"))
                .TipoB = convertDTFromDb.ConvertShort(dr.Item("TipoB"))
                .Usr = convertDTFromDb.ConvertString(dr.Item("Usr"))
                .UsrCancela = convertDTFromDb.ConvertString(dr.Item("UsrCancela"))
            End With
            Return tmpPagos
        Catch ex As Exception
            Throw
        Finally
            tmpPagos = Nothing
        End Try
    End Function
End Class
